<?php

namespace maotool\src\test;

use maotool\captcha\CaptchaUtil;
use maotool\util\IdUtil;
use PHPUnit\Framework\TestCase;

class CaptchaUtilTest extends TestCase
{

    public function testDemo1()
    {
        $key = IdUtil::simpleUUID();
        $captcha = CaptchaUtil::create($key);
        $captcha->setCode("AaaA");
        $captcha->createCode();
        var_dump(CaptchaUtil::get($key)->getCode());
        var_dump(CaptchaUtil::get($key)->verify(CaptchaUtil::get($key)->getCode()));
        var_dump(CaptchaUtil::get($key)->verify("666666"));
        $this->assertTrue(true);
    }

}